import http from "@/utils/http";
import { UploadFile } from "element-plus";
//定义类型（请求参数，返回值类型）
interface ApartmentParamType{
    current:number,
    size:number,
    provinceId?:number,
    cityId?:number,
    districtId?:number
}
interface PageResData<T>{
    records:T[],
    current?:number,
    size?:number
    total:number
}
interface ApartmentData {
    id?: number | string
    name: string
    introduction: string
    districtId: number | string
    districtName?: string
    cityId: number | string
    cityName?: string
    provinceId: number | string
    provinceName?: string
    addressDetail: string
    latitude?: number | string
    longitude?: number | string
    phone: string
    isRelease?: string | number | any
    totalRoomCount?: number
    freeRoomCount?: number
    // 	公寓配套id
    facilityInfoIds?: number[]
    // 	公寓配套信息
    facilityInfoList?: []
    // 	公寓标签id
    labelIds?: number[]
    // 公寓标签信息
    labelInfoList?: []
    // // 	公寓杂费值id
    feeValueIds?: number[]
    // // 	公寓杂费值信息
    feeValueVoList?: []
    // 图片信息 上传和修改详情的图片详情不同
    graphVoList?:
      {
          url: string
          name: number
      }[]
      | UploadFile[]
  }


let getApartmentList = (quaryVo:ApartmentParamType)=>{
    return http.get<PageResData<ApartmentData>>("/admin/apartment/pageItem",quaryVo)
}


export {
    type ApartmentData,
    type ApartmentParamType,
    type PageResData,
    getApartmentList
}
